#include "MyItem.h"
#include <QPainter>

MyItem::MyItem(const QColor& color, int index, QWidget* parent)
	: QWidget(parent)
	, ui(new Ui::MyItemClass())
	, m_color(color)
{
	ui->setupUi(this);
	setMinimumHeight(100);
	setMaximumWidth(100);
	ui->label->setText(QString::number(index));
}

MyItem::~MyItem()
{
	delete ui;
}


void MyItem::paintEvent(QPaintEvent* event)
{
	QPainter painter(this);
	painter.setPen(Qt::NoPen);
	painter.setBrush(m_color);
	painter.drawRect(rect());
}
